<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>交换对象属性值</title>
</head>
<body>
	<script>
		function myFunc(o){
			var s=o.a
			o.a=o.b
			o.b=s
			return "obj.a="+o.a+",obj.b="+o.b
		}
		var obj=new Object()
		obj.a=4
		obj.b=2
		console.log(myFunc(obj))
	</script>
</body>
</html>